// 通过房东要把一个房子通过中介租出去的情况理解代理者模式

#include <iostream>

class RentHouse
{
public:
    virtual void rentHouse() = 0;
};

class LandLord : public RentHouse
{
public:
    void rentHouse() override
    {
        std::cout << "将房子租出去" << std::endl;
    }
};

class Mediator : public RentHouse
{
public:
    void rentHouse() override
    {
        std::cout<<"发布招租启示"<<std::endl;
        std::cout<<"带人看房"<<std::endl;
        _landlord.rentHouse();
        std::cout<<"负责租后维修"<<std::endl;
    }
private:
    LandLord _landlord;
};

int main()
{
    Mediator mediator;
    mediator.rentHouse();
    return 0;
}